// 无人机服务
import { defHttp } from '/@/utils/http/axios';

enum Api {
  /** 任务/条件模块*/
  waylinejobDel = '/uav/waylinejob/del',   // 删除任务
  waylinejobSave = '/uav/waylinejob/save',  // 新增任务
  waylinejobEdit = '/uav/waylinejob/edit',  // 编辑任务
  waylinejobPause = '/uav/waylinejob/pause', // 暂停任务
  waylinejobResume = '/uav/waylinejob/resume', // 恢复任务
  waylinejobGet = '/uav/waylinejob/get',   // 任务详情
  taskQureyTaskListByMonth = '/uav/task/qureyTaskListByMonth', // 任务列表
  taskQureyTaskListByDay = '/uav/task/qureyTaskListByDay',  // 任务列表（按天）
  conditionList = '/uav/condition/list',  // 查询条件管理列表
  conditionSave = '/uav/condition/save',  // 创建条件
  conditionUpdate = '/uav/condition/update',  // 更新条件
  conditionDel = '/uav/condition/del',  // 删除条件
  /** 设备模块*/
  deviceGet = '/uav/device/get', // 查询设备基本信息
  deviceShadowGet = '/uav/device/shadow/get/',  // 查询设备状态数据
  deviceDebugInstructPost = '/uav/device/debug/instruct/post' // 执行指令
}

const uavApi = {
  deleteWaylinejobDel: (params) => defHttp.delete({ url: `${Api.waylinejobDel}?jobId=${params}` }),
  postWaylinejobSave: (params) => defHttp.post({ url: Api.waylinejobSave, params }, { isReturnNativeResponse: true }),
  postWaylinejobEdit: (params) => defHttp.post({ url: Api.waylinejobEdit, params }, { isReturnNativeResponse: true }),
  postWaylinejobPause: (params) => defHttp.post({ url: Api.waylinejobPause, params }, { isReturnNativeResponse: true }),
  postWaylinejobResume: (params) => defHttp.post({ url: Api.waylinejobResume, params }, { isReturnNativeResponse: true }),
  getWaylinejobGet: (params) => defHttp.get({ url: Api.waylinejobGet, params }),
  getTaskQureyTaskListByMonth: (params) => defHttp.get({ url: Api.taskQureyTaskListByMonth, params }),
  getTaskQureyTaskListByDay: (params) => defHttp.get({ url: Api.taskQureyTaskListByDay, params }),
  getConditionList: (params) => defHttp.get({ url: Api.conditionList, params }),
  postConditionSave: (params) => defHttp.post({ url: Api.conditionSave, params }, { isReturnNativeResponse: true }),
  postConditionUpdate: (params) => defHttp.post({ url: Api.conditionUpdate, params }, { isReturnNativeResponse: true }),
  deleteConditionDel: (params) => defHttp.delete({ url: `${Api.conditionDel}?conditionId=${params}` }),
  getDeviceGet: (params) => defHttp.get({ url: Api.deviceGet, params }),
  getDeviceShadowGet: (params) => defHttp.get({ url: Api.deviceShadowGet + params }),
  postDeviceDebugInstructPost: (params) => defHttp.post({ url: Api.deviceDebugInstructPost, params }),
};

export default uavApi